package com.tgy;

/***
 * @ClassName: Say
 * @Description:
 * @Auther: 送你一块二向箔
 * @Date: 18:18 2022/3/23
 * @version : V1.0
 */
public class Say {
    public static void main(String[] args) {
        String s = removePhoneNum("我的电话号码是：13888888888，你的电话号码是：13999999999");
        System.out.println(s);
        System.out.println(similarity("客户表示开通长期流量提速包后还是没有恢复网速，换机换卡测试还是一样，身边其他号码正常", "换"));
    }


    //剔除文字中的电话号码
    public static String removePhoneNum(String str) {
        String regEx = "[0-9]{11}";
        return str.replaceAll(regEx, "");
    }
    //判断文字的相似度
    public static double similarity(String str1, String str2) {
        String newStr1 = removePhoneNum(str1);
        String newStr2 = removePhoneNum(str2);
        int len1 = newStr1.length();
        int len2 = newStr2.length();
        int temp = Math.max(len1, len2);
        int temp2 = Math.min(len1, len2);
        int temp3 = temp - temp2;
        int temp4 = temp2 + temp3;
        double temp5 = temp4;
        double temp6 = temp2;
        double temp7 = temp5 / temp6;
        return temp7;
    }
}
